package com.boot.security.server.utils;

import java.util.UUID;

/**
 * @author LF
 * @date 2020/8/16 - 13:44
 */
public class UUIDUtils {
    public static String getUUID() {
        return UUID.randomUUID().toString().replace("-", "");
    }

    public static String getID() {
        Integer orderId = UUID.randomUUID().toString().hashCode();
        orderId = orderId < 0 ? -orderId : orderId; //String.hashCode() 值会为空
        return orderId.toString();
    }

    public static void main(String[] args) {

        System.out.println(UUIDUtils.getID());

    }
}
